// EnvVarsDlg.h : header file
//

#if !defined(AFX_ENVVARSDLG_H__4BE6ED4D_72CF_4C1E_972C_0471E947D9ED__INCLUDED_)
#define AFX_ENVVARSDLG_H__4BE6ED4D_72CF_4C1E_972C_0471E947D9ED__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define IDM_SYS_ADD_VAL 2001
#define IDM_SYS_MOD_VAL 2002
#define IDM_SYS_DEL_VAL 2003
#define IDM_USR_ADD_VAL 2004
#define IDM_USR_MOD_VAL 2005
#define IDM_USR_DEL_VAL 2006

/////////////////////////////////////////////////////////////////////////////
// CEnvVarsDlg dialog

class CEnvVarsDlg : public CDialog
{
// Construction
public:
	CEnvVarsDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CEnvVarsDlg)
	enum { IDD = IDD_ENVVARS_DIALOG };
	CPathListBox	_listCtrlSys;
	CPathListBox	_listCtrlUser;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CEnvVarsDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	virtual void OnOK();
	//}}AFX_VIRTUAL
	void LoadEnvVars();
	void CommitEnvVars( String const & strEnvKey, String const & strVarName, String const & strValue );
	void OnAddVal( CPathListBox & listCtrl, bool bIsUser, StringArray & arrVars, String const & strEnvKey, String const & strVarName );
	void OnModVal( CPathListBox & listCtrl, bool bIsUser, StringArray & arrVars, String const & strEnvKey, String const & strVarName );
	void UpdateVarsList( CPathListBox & listCtrl, StringArray & arrVars );
	void UpdateUserVarsList();
	void UpdateSysVarsList();
// Implementation
protected:
	HICON m_hIcon;
	StringArray _userVars;
	StringArray _sysVars;
	String _strVarName;
	String _strUserEnvKey;
	DWORD _dwRegTypeUserVar;
	String _strSysEnvKey;
	DWORD _dwRegTypeSysVar;
	bool _bHasModified;

	// Generated message map functions
	//{{AFX_MSG(CEnvVarsDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnDblclkListUserVars();
	afx_msg void OnDblclkListSysVars();
	afx_msg void OnSysAddVal();
	afx_msg void OnSysModVal();
	afx_msg void OnUsrAddVal();
	afx_msg void OnUsrModVal();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_ENVVARSDLG_H__4BE6ED4D_72CF_4C1E_972C_0471E947D9ED__INCLUDED_)
